<?php

use yii\db\Migration;

/**
 * Handles the creation of table `record`.
 */
class m181104_055412_create_record_table extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->createTable('record', [
            'id' => $this->primaryKey(),
            'openid' => $this->string(32)->notNull()->comment('用户id'),
            'name' => $this->string(255)->notNull()->comment('用户姓名'),
            'mobile' => $this->string(255)->notNull()->comment('用户电话'),
            'number' => $this->string(32)->notNull()->comment('号码牌'),
            'awards_id' => $this->integer(11)->notNull()->defaultValue(0)->comment('中的奖项'),
            'created_at' => $this->integer(11)->notNull()->defaultValue(0)->comment('中奖时间'),
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable('record');
    }
}
